﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._03_AbstractFactory
{
    // 支付接口
    public interface IPayment
    {
        void Pay(decimal amount);
    }

    // 验证接口
    public interface IValidator
    {
        bool ValidatePayment();
    }

    /// <summary>
    /// 国内支付实现
    /// </summary>
    public class DomesticAlipay : IPayment
    {
        public void Pay(decimal amount) => Console.WriteLine($"国内支付宝支付: {amount}元");
    }
    /// <summary>
    /// 
    /// </summary>
    public class DomesticWechatPay : IPayment
    {
        public void Pay(decimal amount) => Console.WriteLine($"国内微信支付: {amount}元");
    }
    // 国际支付实现
    public class InternationalAlipay : IPayment
    {
        public void Pay(decimal amount) => Console.WriteLine($"国际支付宝支付: {amount}美元");
    }

    public class InternationalWechatPay : IPayment
    {
        public void Pay(decimal amount) => Console.WriteLine($"国际微信支付: {amount}美元");
    }

    // 国内验证实现
    public class DomesticValidator : IValidator
    {
        public bool ValidatePayment()
        {
            Console.WriteLine("执行国内支付验证...");
            return true;
        }
    }

    // 国际验证实现
    public class InternationalValidator : IValidator
    {
        public bool ValidatePayment()
        {
            Console.WriteLine("执行国际支付验证...");
            return true;
        }
    }
}
